import sys
sys.path.append('..')
from source.entity.Base import session
from source.entity.CeilometerMetrics import CeilometerMetrics
from datetime import datetime
nedn = '13312858-5f85-49b9-bdaa-c2baa7f3af56'
granularity = '300'
begintime =  '2017-09-28T05:45:10.176000'
endtime = '2017-09-28T05:45:10.176000'
cpuusageatio = 93.2
memoryusageratio = 60.3
diskreadbytes = 12142.2
diskwritebytes = 12532.2
networkincomingbytes = 2112.2
networkoutgoingbytes = 212.2
alarmnums = 2
cm = CeilometerMetrics(nedn, granularity, begintime, endtime, cpuusageatio, memoryusageratio, diskreadbytes, diskwritebytes, networkincomingbytes, networkoutgoingbytes, alarmnums)
session.add(cm)
session.commit()